- user = spam_log.user
%tr
  %td
    = time_ago_with_tooltip(spam_log.created_at)
  %td
    - if user
      = link_to user.name, [:admin, user]
      .light.small
        = _('Joined %{user_created_time}').html_safe % { user_created_time: time_ago_with_tooltip(user.created_at) }
    - else
      = _('(removed)')
  %td
    = spam_log.source_ip
  %td
    = spam_log.via_api? ? 'Y' : 'N'
  %td
    = spam_log.recaptcha_verified ? 'Y' : 'N'
  %td
    = spam_log.noteable_type
  %td
    = spam_log.title
  %td
    = truncate(spam_log.description, length: 100)
  %td
    = moderation_status(user)
  %td
    - if user
      = render Pajamas::ButtonComponent.new(size: :small,
        variant: :danger,
        method: :delete,
        href: admin_spam_log_path(spam_log, remove_user: true),
        button_options: { data: { confirm: _("USER %{user_name} WILL BE REMOVED! Are you sure?") % { user_name: user.name }, confirm_btn_variant: 'danger' }, aria: { label: _('Remove user') } }) do
        = _('Remove user')
  %td
    -# TODO: Remove conditonal once spamcheck supports this https://gitlab.com/gitlab-com/gl-security/engineering-and-research/automation-team/spam/spamcheck/-/issues/190
    - if akismet_enabled?
      - if spam_log.submitted_as_ham?
        = render Pajamas::ButtonComponent.new(size: :small,
          button_options: { class: 'disabled gl-mb-3'}) do
          = _("Submitted as ham")
      - else
        = render Pajamas::ButtonComponent.new(size: :small,
          method: :post,
          href: mark_as_ham_admin_spam_log_path(spam_log),
          button_options: { class: ' gl-mb-3' }) do
          = _('Submit as ham')
    - if user && !user.blocked?
      = render Pajamas::ButtonComponent.new(size: :small,
        method: :put,
        href: block_admin_user_path(user),
        button_options: { class: 'gl-mb-3', data: {confirm: _('USER WILL BE BLOCKED! Are you sure?')} }) do
        = _('Block user')
    - else
      = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: 'disabled gl-mb-3'}) do
        = _("Already blocked")
    = render Pajamas::ButtonComponent.new(size: :small,
      method: :delete,
      href: [:admin, spam_log],
      button_options: { class: 'js-remove-tr', remote: true, }) do
      = _('Remove log')
